import indexModel from '../../models/indexModel'

// 图片swiper
export const getSwiperData = () => dispatch => {
  // 网络请求
  indexModel.getSwiper().then(ret => {
    dispatch({
      type: 'setSwiper',
      payload: ret.data.data
    })
  })
}

// 热门
export const getHotCateData = () => dispatch => {
  indexModel.getHotCateData().then(ret => {
    dispatch({
      type: 'getHotCateData',
      payload: ret
    })
  })
}


// 精品菜品
export const getGookCookData = (page = 1) => dispatch => {
  indexModel.getGookCookData(page).then(ret => {
    dispatch({
      type: 'setGookCookData',
      payload: ret
    })
  })
}